﻿using Microsoft.AspNetCore.Mvc;
using ST.Buz.Base.ViewModel;
using ST.Common.Util.Model;
using ST.Common.Util.Mvc;
using ST.Common.Util.Text;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ST.Buz.Web.Components
{
    public class SysEnumCodeTreeViewComponent : ViewComponent
    {
        //public async Task<IViewComponentResult> InvokeAsync(string id, string catid, string orgid)
        //{
        //	var result = await GetItemsAsync(id, catid, orgid);
        //	return View();
        //}

        public IViewComponentResult Invoke(string callback, string treeid, int id, string code, int orgid)
        {
            ViewData["callback"] = string.IsNullOrWhiteSpace(callback) ? "sysEnumCodeTreeCallback" : callback;
            ViewData["treeid"] = string.IsNullOrWhiteSpace(treeid) ? "sysEnumCodeTree" : treeid;
            ViewData["id"] = id;
            ViewData["code"] = code;
            ViewData["orgid"] = orgid;
            return View();
        }

        //private Task<int> GetItemsAsync(string id, string catid, string orgid)
        //{
        //	return Task.FromResult(123);
        //}
    }
}
